<?php
/**
 * appRain v 0.1.x
 *
 * LICENSE
 *
 * This source file is subject to the MIT license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/mit-license.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@apprain.com so we can send you a copy immediately.
 *
 * @copyright  Copyright (c) 2010 appRain, Team. (http://www.apprain.com)
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 *
 * HELP
 *
 * Official Website
 * http://www.apprain.com/
 *
 * Download Link
 * http://www.apprain.com/download
 *
 * Documents Link
 * http ://www.apprain.com/docs
 */
 ?>
 <?php App::Helper('Toolbar')->setTitle("MVC Manager")->setBtnBack()->Render(array('code'=>'mvc_manager_list_top')); ?>
 <br class="clearboth" />
    <ul>
    <?php
    foreach( $mvcdata as $mvckey => $mvcval ):  ?>
        <li>
        <div class="app_box">
            <h3 class="app_box_title toggler"><span class="box-button"> </span><?php echo $mvckey; ?> <?php echo $mvcval['model']['version']; ?></h3>
            <div class="box-body element">
                <div class="node">
                    <?php
                        $Grid = App::Module('DataGrid')->clear()->setDisplay('FormListing');
                        $Grid->addRow("Model Name",$mvcval['model']['name']/* . " " . App::Load("Helper/Html")->linkTag( $this->baseurl("/developer/editor/" . base64_encode($mvcval['model']["path"]) . "/" . base64_encode(strtolower($mvcval['model']["name"]) . ".php")),"Edit")*/)
                             ->addRow("Model Version",$mvcval['model']['version'])
                             ->addRow("Model Table",($mvcval['model']['db_table']) ? $mvcval['model']['db_table'] : "<span style=\"color:#FF0000\">No Available</span>");

                        if( $mvcval['model']['insteller']['exists'] ):
                            $Grid->addRow("Installer","Yes");
                        else:
                            $Grid->addRow("Installer","<span style=\"color:#FF0000\">No Available</span>");
                        endif;
						/*
                        if($mvcval['controller']['exists']) :
                            $Grid->addRow("Controller Name",$mvcval['controller']['name']);
                        else:
                            $Grid->addRow("Controller Status","<span style=\"color:#FF0000\">No Available</span>");
                        endif;

                        if($mvcval['view']['exists']) :
                            $Grid->addRow("Total Views",count($mvcval['view']['files']));
                            $str = "";
                            foreach( $mvcval['view']['files'] as $val )
                            {
                                $str .= ($str!="" )  ? $this->get_tag("br","/") : $str;
                                $str .=  $val['file_name'];// . " ".  App::Load("Helper/Html")->linkTag( $this->baseurl("/developer/editor/" . base64_encode($val["path"]) . "/" . base64_encode($val["file_name"])),"Edit") . " " . App::Load("Helper/Html")->linkTag($val['url'],"View");
                            }
                            $Grid->addRow("Manage Views","{$str} ");
                        else:
                            $Grid->addRow("View Status","<span style=\"color:#FF0000\">No Available</span>");
                        endif;*/
                        $Grid->Render();
                        ?>
                </div>
            </div>
        </div>
        </li>
    <?php  endforeach; ?>
    </ul>
    <?php   if( $this->get_config('disable_accordion') != 'Yes') : ?>
    <script type="text/javascript">
       var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
            opacity: false,
            onActive: function(toggler, element){
                toggler.setStyle('color', '#FFFFFF');
            },
            onBackground: function(toggler, element){
                toggler.setStyle('color', '#FFFFFF');
            }
        });
    </script>
    <?php endif; ?>
    <?php App::Helper('Toolbar')->setBtnBack()->Render(array('code'=>'mvc_manager_list_bottom')); ?>